package com.neusoft.shopingapi.controller;

import com.neusoft.shopingapi.entity.TypeEntity;
import com.neusoft.shopingapi.service.PictureService;
import com.neusoft.shopingapi.service.Typeservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@CrossOrigin
@RestController
public class Typecontroller {
    @Autowired
    private Typeservice typeservice;
    @GetMapping("/qureyType")
    public Map<String,Object> qureyAll(){
         List<TypeEntity> typeList = typeservice.qureyAll();
        Map<String,Object> map = new ConcurrentHashMap<>();
        map.put("code",new Integer(100000));
        map.put("msg","分类查询成功!!!");
        map.put("data",typeList);
        return map;
    }
}
